/* GUI CONVERTED from reworp05.p (converter v1.75) Thu Oct  5 12:01:24 2000 */
/* reworp05.p - REPETITIVE                                                    */
/* Copyright 1986-2002 QAD Inc., Carpinteria, CA, USA.                        */
/* All rights reserved worldwide.  This is an unpublished work.               */
/*F0PN*/ /*V8:ConvertMode=FullGUIReport                                       */
/* REVISION: 7.3      LAST MODIFIED: 10/31/94   BY: WUG *GN77*                */
/* REVISION: 8.6      LAST MODIFIED: 10/14/97   BY: GYK *K0YN*                */
/* REVISION: 8.6E     LAST MODIFIED: 02/23/98   BY: *L007* A. Rahane          */
/* REVISION: 8.6E     LAST MODIFIED: 10/04/98   BY: *J314* Alfred Tan         */
/* REVISION: 9.1      LAST MODIFIED: 10/25/99   BY: *N002* Bill Gates         */
/* REVISION: 9.1      LAST MODIFIED: 11/17/99   BY: *N04H* Vivek Gogte        */
/* REVISION: 9.1      LAST MODIFIED: 03/24/00   BY: *N08T* Annasaheb Rahane   */
/* REVISION: 9.1      LAST MODIFIED: 07/25/00   BY: *N0GQ* Mudit Mehta        */
/* REVISION: 9.1      LAST MODIFIED: 10/05/00   BY: *N0RQ* Jean Miller        */

/* WIP STATUS REPORT                                                          */


/*GUI global preprocessor directive settings */
&GLOBAL-DEFINE PP_PGM_RP TRUE
&GLOBAL-DEFINE PP_ENV_GUI TRUE


/*GUI preprocessor directive settings */
&SCOPED-DEFINE PP_GUI_CONVERT_MODE REPORT

/*K0YN*/ {mfdtitle.i "b+ "}

/* ********** Begin Translatable Strings Definitions ********* */

&SCOPED-DEFINE reworp05_p_1 "Quantity"
/* MaxLen: Comment: */

&SCOPED-DEFINE reworp05_p_2 "Reject Queue"
/* MaxLen: Comment: */

&SCOPED-DEFINE reworp05_p_3 "Cum Moved In"
/* MaxLen: Comment: */

&SCOPED-DEFINE reworp05_p_5 "Output Queue"
/* MaxLen: Comment: */

&SCOPED-DEFINE reworp05_p_8 "Op"
/* MaxLen: Comment: */

&SCOPED-DEFINE reworp05_p_9 "End Effective"
/* MaxLen: Comment: */

&SCOPED-DEFINE reworp05_p_19 "Mile-!stone"
/* MaxLen: Comment: */

&SCOPED-DEFINE reworp05_p_20 "Input Queue"
/* MaxLen: Comment: */

/*N0GQ*------------START COMMENT----------------
 * &SCOPED-DEFINE reworp05_p_4 "-Adjusted"
 * /* MaxLen: Comment: */
 *
 * &SCOPED-DEFINE reworp05_p_6 "Current Qty"
 * /* MaxLen: Comment: */
 *
 * &SCOPED-DEFINE reworp05_p_7 "-Moved Out"
 * /* MaxLen: Comment: */
 *
 * &SCOPED-DEFINE reworp05_p_10 "-Processed"
 * /* MaxLen: Comment: */
 *
 * &SCOPED-DEFINE reworp05_p_11 "Begin Qty"
 * /* MaxLen: Comment: */
 *
 * &SCOPED-DEFINE reworp05_p_12 "-Scrapped"
 * /* MaxLen: Comment: */
 *
 * &SCOPED-DEFINE reworp05_p_13 "+Rejected"
 * /* MaxLen: Comment: */
 *
 * &SCOPED-DEFINE reworp05_p_14 "+Reworked"
 * /* MaxLen: Comment: */
 *
 * &SCOPED-DEFINE reworp05_p_15 "-Reworked"
 * /* MaxLen: Comment: */
 *
 * &SCOPED-DEFINE reworp05_p_16 "-Rejected"
 * /* MaxLen: Comment: */
 *
 * &SCOPED-DEFINE reworp05_p_17 "+Processed"
 * /* MaxLen: Comment: */
 *
 * &SCOPED-DEFINE reworp05_p_18 "+Moved In"
 * /* MaxLen: Comment: */
 *N0GQ*----------END COMMENT----------------- */

/* ********** End Translatable Strings Definitions ********* */

/*N04H*  {rewrsdef.i}                */

/*K0YN*/ define variable line     like wo_line.
/*K0YN*/ define variable line1    like wo_line label {t001.i}.
/*K0YN*/ define variable lot      like wo_lot.
/*K0YN*/ define variable lot1     like wo_lot label {t001.i}.
/*K0YN*/ define variable part     like wo_part.
/*K0YN*/ define variable part1    like wo_part label {t001.i}.
/*K0YN*/ define variable site     like wo_site.
/*K0YN*/ define variable site1    like wo_site label {t001.i}.
/*K0YN*/ define variable endeff   as date label {&reworp05_p_9}.
/*K0YN*/ define variable endeff1  as date label {t001.i}.
/*K0YN*/ define variable first_op like mfc_logical.
/*K0YN*/ define variable moved_in like wr_qty_cummove label {&reworp05_p_3}.

/*K0YN*/ define variable inque_label  as character format "x(13)"
                                      label {&reworp05_p_20}.
/*K0YN*/ define variable outque_label as character format "x(13)"
                                      label {&reworp05_p_5}.
/*K0YN*/ define variable rejque_label as character format "x(13)"
                                      label {&reworp05_p_2}.
/*K0YN*/ define variable inque_value  as decimal format "->>,>>>,>>9.9<<<<<<<<"
                                      label {&reworp05_p_1}.
/*K0YN*/ define variable outque_value as decimal format "->>,>>>,>>9.9<<<<<<<<"
                                      label {&reworp05_p_1}.
/*K0YN*/ define variable rejque_value as decimal format "->>,>>>,>>9.9<<<<<<<<"
                                      label {&reworp05_p_1}.
/*N002*/ define variable h_wiplottrace_funcs as handle no-undo.
/*N0GQ*
 * /*K0YN*/ define variable beginquelabel as character init {&reworp05_p_11}.
 * /*K0YN*/ define variable procinlabel as character init {&reworp05_p_17}.
 * /*K0YN*/ define variable procoutlabel as character init {&reworp05_p_10}.
 * /*K0YN*/ define variable curquelabel as character init {&reworp05_p_6}.
 * /*K0YN*/ define variable movedinlabel as character init {&reworp05_p_18}.
 * /*K0YN*/ define variable movedoutlabel as character init {&reworp05_p_7}.
 * /*K0YN*/ define variable rejectinlabel as character init {&reworp05_p_13}.
 * /*K0YN*/ define variable rejectoutlabel as character init {&reworp05_p_16}.
 * /*K0YN*/ define variable reworkinlabel as character init {&reworp05_p_14}.
 * /*K0YN*/ define variable reworkoutlabel as character init {&reworp05_p_15}.

 * /*K0YN*/ define variable scraplabel as character init {&reworp05_p_12}.
 * /*K0YN*/ define variable adjustlabel as character init {&reworp05_p_4}.
 *N0GQ*/
/*N0GQ*/ define variable beginquelabel  as character.
/*N0GQ*/ define variable procinlabel    as character.
/*N0GQ*/ define variable procoutlabel   as character.
/*N0GQ*/ define variable curquelabel    as character.
/*N0GQ*/ define variable movedinlabel   as character.
/*N0GQ*/ define variable movedoutlabel  as character.
/*N0GQ*/ define variable rejectinlabel  as character.
/*N0GQ*/ define variable rejectoutlabel as character.
/*N0GQ*/ define variable reworkinlabel  as character.
/*N0GQ*/ define variable reworkoutlabel as character.
/*N0GQ*/ define variable scraplabel     as character.
/*N0GQ*/ define variable adjustlabel    as character.

/*N0GQ*/ assign
            beginquelabel    = getTermLabel("BEGIN_QTY",13)
            procinlabel      = "+" + getTermLabel("PROCESSED",12)
            procoutlabel     = "-" + getTermLabel("PROCESSED",12)
            curquelabel      = getTermLabel("CURRENT_QTY",13)
            movedinlabel     = "+" + getTermLabel("MOVED_IN",12)
            movedoutlabel    = "-" + getTermLabel("MOVED_OUT",12)
            rejectinlabel    = "+" + getTermLabel("REJECTED",12)
            rejectoutlabel   = "-" + getTermLabel("REJECTED",12)
            reworkinlabel    = "+" + getTermLabel("REWORKED",12)
            reworkoutlabel   = "-" + getTermLabel("REWORKED",12)
            scraplabel       = "-" + getTermLabel("SCRAPPED",12)
            adjustlabel      = "-" + getTermLabel("ADJUSTED",12).

/*N002*/ {wlfnc.i} /* FUNCTION FORWARD DECLARATIONS */

         
/*GUI preprocessor Frame A define */
&SCOPED-DEFINE PP_FRAME_NAME A

FORM /*GUI*/ 
            
 RECT-FRAME       AT ROW 1.4 COLUMN 1.25
 RECT-FRAME-LABEL AT ROW 1   COLUMN 3 NO-LABEL
 SKIP(.1)  /*GUI*/
lot              colon 20
            lot1             colon 45
            part             colon 20
            part1            colon 45
            site             colon 20
            site1            colon 45
            line         colon 20
            line1        colon 45
            endeff       colon 20
            endeff1      colon 45
          SKIP(.4)  /*GUI*/
with frame a side-labels width 80 attr-space NO-BOX THREE-D /*GUI*/.

 DEFINE VARIABLE F-a-title AS CHARACTER.
 F-a-title = &IF (DEFINED(SELECTION_CRITERIA) = 0)
  &THEN " Selection Criteria "
  &ELSE {&SELECTION_CRITERIA}
  &ENDIF .
 RECT-FRAME-LABEL:SCREEN-VALUE in frame a = F-a-title.
 RECT-FRAME-LABEL:WIDTH-PIXELS in frame a =
  FONT-TABLE:GET-TEXT-WIDTH-PIXELS(
  RECT-FRAME-LABEL:SCREEN-VALUE in frame a + " ", RECT-FRAME-LABEL:FONT).
 RECT-FRAME:HEIGHT-PIXELS in frame a =
  FRAME a:HEIGHT-PIXELS - RECT-FRAME:Y in frame a - 2.
 RECT-FRAME:WIDTH-CHARS IN FRAME a = FRAME a:WIDTH-CHARS - .5. /*GUI*/

/*GUI preprocessor Frame A undefine */
&UNDEFINE PP_FRAME_NAME



         /* SET EXTERNAL LABELS */
         setFrameLabels(frame a:handle).

         find first gl_ctrl no-lock.

/*K0YN*/ {wbrp01.i}

         
/*GUI*/ {mfguirpa.i true  "printer" 132 }

/*GUI repeat : */
/*GUI*/ procedure p-enable-ui:


            if lot1 = hi_char then lot1 = "".
            if part1 = hi_char then part1 = "".
            if site1 = hi_char then site1 = "".
            if line1 = hi_char then line1 = "".

/*K0YN*/    if c-application-mode <> 'web':u then
            
run p-action-fields (input "display").
run p-action-fields (input "enable").
end procedure. /* p-enable-ui, replacement of Data-Entry GUI*/

/*GUI*/ procedure p-report-quote:


/*K0YN*/   {wbrp06.i &command = update
                     &fields = "  lot lot1 part part1 site site1
                                 line line1 endeff endeff1"
                     &frm = "a"}

/*K0YN*/    if (c-application-mode <> 'web') or
/*K0YN*/       (c-application-mode = 'web' and
/*K0YN*/       (c-web-request begins 'data'))
            then do:

               bcdparm = "".
               {mfquoter.i lot          }
               {mfquoter.i lot1         }
               {mfquoter.i part         }
               {mfquoter.i part1        }
               {mfquoter.i site         }
               {mfquoter.i site1        }
               {mfquoter.i line         }
               {mfquoter.i line1        }
               {mfquoter.i endeff           }
               {mfquoter.i endeff1          }

               if lot1 = "" then lot1 = hi_char.
               if part1 = "" then part1 = hi_char.
               if site1 = "" then site1 = hi_char.
               if line1 = "" then line1 = hi_char.

/*K0YN*/    end.

            
/*GUI*/ end procedure. /* p-report-quote */
/*GUI - Field Trigger Section */

/*GUI MFSELxxx removed*/
/*GUI*/ procedure p-report:
/*GUI*/   {gpprtrpa.i  "printer" 132}
/*GUI*/   mainloop: do on error undo, return error on endkey undo, return error:
find first gl_ctrl no-lock.



            {mfphead.i}

            /*NOTE: LOOK AT ALL ORDERS CLOSED OR NOT*/
            moved_in = 0.

            
/*GUI mainloop removed */

            for each wo_mstr no-lock
            where wo_type = "c"
            and wo_lot >= lot and wo_lot <= lot1
            and wo_part >= part and wo_part <= part1
            and wo_site >= site and wo_site <= site1
            and wo_line >= line and wo_line <= line1
            and (wo_due_date >= endeff or endeff = ?)
            and (wo_due_date <= endeff1 or endeff1 = ?)
            and wo_nbr = ""
            use-index wo_type_part,
            each pt_mstr no-lock
            where pt_part = wo_part,
            each pl_mstr no-lock
            where pl_prod_line = pt_prod_line
            by substring(wo_type,1,1) by wo_site by wo_part
            by wo_line by wo_due_date by wo_lot:

               {gprun.i ""rewodisp.p"" "(input wo_lot)"}

/*K0YN*        disp */
/*K0YN*/       display skip with frame dummy1 STREAM-IO /*GUI*/ .

               for each wr_route no-lock
               where wr_lot = wo_lot
/*N0GQ*        break by wr_op: */
/*N0GQ*/       break by wr_op with frame f-a:

                  if page-size - line-counter < 9 then page.

/*N04H*           {rewrsget.i &lot=wr_lot &op=wr_op &lock=no-lock}          */

                  FORM /*GUI*/ 
                     wr_op                  column-label {&reworp05_p_8}
                     wr_desc
                     wr_milestone       column-label {&reworp05_p_19}
                     space(3)
                     inque_label
                     inque_value
                     space(3)
                     outque_label
                     outque_value
                     space(3)
                     rejque_label
                     rejque_value
/*N0GQ*           with width 132 no-box. */
/*N0GQ*/          with STREAM-IO /*GUI*/  frame f-a width 132 no-box.

                  /* SET EXTERNAL LABELS */
/*N0GQ*/          setFrameLabels(frame f-a:handle).

                  first_op = first(wr_op).

/*K0YN*           disp */
/*K0YN*/          display
                     wr_op
                     wr_desc
                     wr_milestone WITH STREAM-IO /*GUI*/ .

                  {rewoiq05.i}

                  down 1.

                  
/*GUI*/ {mfguichk.i  &label=mainloop} /*Replace mfrpchk*/


/*N002*/          if is_wiplottrace_enabled() then do:
/*N002*/             {gprunmo.i
                       &program=""rewoiqa.p""
                       &module="AWT"
                       &param="""(input wr_lot, input wr_op, input pt_um)"""}
/*N002*/          end.
/*N002*/          pause 0.
/*N002*/          display skip(1) with frame dummy3 STREAM-IO /*GUI*/ .

                  moved_in = wr_qty_cummove.

               end.

/*K0YN*        disp */
/*K0YN*/       display skip(1) with frame dummy2 STREAM-IO /*GUI*/ .

               
/*GUI*/ {mfguichk.i } /*Replace mfrpchk*/


            end.

            
/*GUI*/ {mfguitrl.i} /*Replace mfrtrail*/

/*GUI*/ {mfgrptrm.i} /*Report-to-Window*/


         end.

/*K0YN*/ {wbrp04.i &frame-spec = a}

/*GUI*/ end procedure. /*p-report*/
/*GUI*/ {mfguirpb.i &flds=" lot lot1 part part1 site site1 line line1 endeff endeff1 "} /*Drive the Report*/
